const timer = ref<number | null>(null);
const seconds = ref(0);
export function useTimer() {
  const startTimer = () => {
    if (!timer.value) {
      timer.value = setInterval(() => {
        seconds.value++;
      }, 1000);
    }
  };
  const pauseTimer = () => {
    if (timer.value) {
      clearInterval(timer.value);
      console.log("Timer paused");
      timer.value = null;
    }
  };

  const resetSeconds = () => {
    seconds.value = 0;
  };
  return {
    seconds,
    startTimer,
    pauseTimer,
    resetSeconds,
  };
}
